package com.androidsocketd.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;

import com.androidsocketd.bean.Post;
import com.androidsocketd.bean.Product;

import java.util.List;


/**
 * Created by yao on 2021/3/23.
 * Describe
 */

@Dao
public interface PostDao {

    @Query("SELECT * FROM Post ORDER BY id desc")
    List<Post> getAllPost();
    @Query("SELECT * FROM Post WHERE recordId=:recordId")
    Post getPostOneById(String recordId);
    @Insert
    void insert(Post post);
    @Insert
    void insert(List<Post> postes);
    @Delete
    void delete(Post post);
    @Delete
    void delete(List<Post> userLists);
}